<!DOCTYPE HTML>
<html>
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
    <title></title>
    <meta name="keywords" content=""/>
    <meta name="description" content=""/>
    <meta name="generator" content=""/>
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport" content="width=device-width; initial-scale=1.0; maximum-scale=1.0; user-scalable=0;">
    <link href="../../css/htmlAll/haiersoft.css" rel="stylesheet" type="text/css" media="screen,print"/>
    <link href="../../css/htmlAll/print.css" rel="stylesheet" type="text/css" media="print"/>
    <script src="../../js/vendor/jquery-3.2.1.min.js"></script>
    <script src="../../js/htmlAll/side.js" type="text/javascript"></script>
    <script src="../../js/public/public.js" type="text/javascript"></script>
    <script src="../../js/htmlAll/score.js" type="text/javascript"></script>
    <script type="text/javascript">
        $(document).ready(function () {
            $.ajax({
                "url": url + departmentArray,
                "type": 'get',
                "dataType": "json",
                "success": function (data) {
                    var res = eval('(' + JSON.stringify(data) + ')');
                    if (res.resultCode != 200) {
                        error(data);
                        return;
                    }
                    depAppands(res.obj);

                },
                "error": error()
            })

        })

        function asd(obj,va){
               $( "#dt").html($(obj).html());
                $("#dd").hide();
            $.ajax({
                "url": url + userNumberOneUrl+"?depId="+va,
                "type": 'get',
                "dataType": "json",
                "success": function (data) {
                    var res = eval('(' + JSON.stringify(data) + ')');
                    if (res.resultCode != 200) {
                        error(data);
                        return;
                    }
                    thisFill(res.obj);
                },
                "error": error()
            })
        }

        function thisFill(rank){
            var rankRes = eval('(' + JSON.stringify(rank) + ')');
            $("#allSumRankScore").empty()
            $("#allCountRankScore").empty()
            $("#allAvgRankScore").empty()

            $("#allSumRankScore").append(rankRes.sumNme+"总分"+sorecText(rankRes.allSumRankScore));
            $("#allCountRankScore").append(rankRes.countName+"总人数"+sorecText(rankRes.allCountRankScore));
            $("#allAvgRankScore").append(rankRes.avgName+"总平均"+sorecText(rankRes.allAvgRankScore));


        }

        function depAppands(data) {
            var array = data;
            var is="";
            for (var i = 0; i < array.length; i++) {
                is+="<li><a href=\"#\" onclick=\"asd(this,"+array[i].id+")\">"+array[i].name+"</a></li>";
            }
            $("#ul").empty()
            $("#ul").append(is);
        }

    </script>

    <script type="text/javascript">
        $(function () {
            $(".select").each(function () {
                var s = $(this);
                var z = parseInt(s.css("z-index"));
                var dt = $(this).children("dt");
                var dd = $(this).children("dd");
                var _show = function () {
                    dd.slideDown(200);
                    dt.addClass("cur");
                    s.css("z-index", z + 1);
                };
                var _hide = function () {
                    dd.slideUp(200);
                    dt.removeClass("cur");
                    s.css("z-index", z);
                };
                dt.click(function () {
                    dd.is(":hidden") ? _show() : _hide();
                });
                dd.find("a").click(function () {
                    dt.html($(this).html());
                    _hide();
                });
                $("body").click(function (i) {
                    !$(i.target).parents(".select").first().is(s) ? _hide() : "";
                });
            })
        })
    </script>
    <!--[if lt IE 9]>
    <script src="http://html5shiv.googlecode.com/svn/trunk/html5.js"></script>
    <script src="http://css3-mediaqueries-js.googlecode.com/svn/trunk/css3-mediaqueries.js"></script>
    <![endif]-->
</head>

<body>
<!-- Popup -->
<div id="Popup">

    <div class="form_boxC">
        <input type="hidden" id="departmentId" value=""/>
        <table cellpadding="0" cellspacing="0" id="tableInfo">
            <tr>
                <th>学系 </th>
                <td><!-- selectbox -->
                    <div class="selectbox" style="width:230px;">
                        <dl class="select">
                            <dt id ="dt">请选择</dt>
                            <dd id="dd">
                                <ul id="ul">
                                </ul>
                            </dd>
                        </dl>
                    </div>
                    <!-- /selectbox --></td>
            </tr>
        </table>
    </div>
    <!-- SubPopup -->
    <div id="SubPopup">
        <div class="form_boxC">
            <table cellpadding="0" cellspacing="0" id="">
                <tr>
                    <th width="100">系内总评分No.1</th>
                    <td>
                        <div class="txtbox floatL" style="width:100px;" id="allSumRankScore">
                        </div>
                    </td>
                </tr>
                <tr>
                    <th width="100">系内总评分人数No.1</th>
                    <td>
                        <div class="txtbox floatL" style="width:100px;" id="allCountRankScore">
                        </div>
                    </td>
                </tr>
                <tr>
                    <th width="100">系内总评分平均分No.1</th>
                    <td>
                        <div class="txtbox floatL" style="width:100px;" id="allAvgRankScore">
                        </div>
                    </td>
                </tr>

            </table>
        </div>
    </div>
    <!-- SubPopup -->

</div>
<!-- /Popup -->
</body>
</html>